//
//  CYLoanSectionView.h
//  CreditAddressBook
//
//  Created by LE on 15/11/5.
//  Copyright © 2015年 Lee. All rights reserved.
//

#import <UIKit/UIKit.h>
@class CYLoanSectionView;

@protocol CYLoanSectionViewDelegate <NSObject>

@optional
- (void)openSection: (CYLoanSectionView *)sectionHeaderView atPosition:(NSInteger)position;
- (void)closeSection: (CYLoanSectionView *)sectionHeaderView atPosition:(NSInteger)position;

@end

@interface CYLoanSectionView : UITableViewHeaderFooterView

@property (weak, nonatomic) IBOutlet UIButton *cartBtn;
@property (weak, nonatomic) IBOutlet UILabel *productNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *loanMoneyLabel;
@property (weak, nonatomic) IBOutlet UIButton *payBackBtn;
@property (weak, nonatomic) id<CYLoanSectionViewDelegate> delegate;
@property(nonatomic, assign) NSInteger section;

/**
 *  该方式未采用重用机制
 */
+ (instancetype)sectionView;

/**
 *  该方法采用重用机制
 *  
 *  先在viewdidload中调用registerHeaderFooterView:tableView方法注册view
 *  再调用headerFooterSectionView:tableView方法得到对象
 */
+ (BOOL)registerHeaderFooterView:(UITableView *)tableView;
+ (instancetype)headerFooterSectionView:(UITableView *)tableView;
@end
